-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): support collecting migrations excluding the already applied ones #14968
feat(core): support collecting migrations excluding the already applied ones #14968
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 9058d73. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
6c8f7d6
to
354ac9e
Compare
I accidentally caused you some conflicts... 😞 Sorry. Otherwise, this only works for packageJsonUpdates right? There's no way to tell if migrations.json generator based updates have previously been applied. |
No worries!
We can tell whether migrations were meant to run based on the currently installed versions and the requirements and target versions of each migration. That's what we're doing here. We definitely don't account for manually removed migrations. If someone needs to run all, they can still run |
0722825
to
2f9a123
Compare
2f9a123
to
eb55a8b
Compare
eb55a8b
to
b4a83f1
Compare
b4a83f1
to
09b8930
Compare
578b560
to
516b55f
Compare
…lude-applied-migrations
516b55f
to
9058d73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a much cleaner experience. I like it
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
To run previously skipped migrations, the user needs to run
nx migrate latest --from=nx@<older version>
. This will collect all migrations from every package collected from the specified older version, regardless of whether the migration ran before. While it shouldn't pose an actual issue (migrations should be idempotent), it does take longer to run things that are not needed and it's harder for the user to know which migrations really matter.Expected Behavior
To collect migrations while excluding migrations that were meant to be applied on previous updates, the user would use a new flag:
nx migrate latest --from=nx@<older version> --exclude-applied-migrations
. Note that migrations manually removed from themigrations.json
on previous updates won't be collected.Related Issue(s)
Fixes #